package cz.data.common.support.db.manage;

import com.alibaba.fastjson.JSONObject;
import cz.data.common.support.db.core.DbColumn;
import cz.data.common.support.db.core.DbTable;

import java.util.List;

public interface ManageDialect {

    default void preProcessData(DbTable table, JSONObject record) {

    }

    default DbColumn findColumn(List<DbColumn> columns, String field) {
        DbColumn column = null;
        for (DbColumn dbColumn : columns) {
            if (dbColumn.getColName().equals(field)) {
                column = dbColumn;
                break;
            }
        }
        return column;
    }
}
